import cv2
import numpy as np
# 将红色区域变为白色，其他区域变为黑色
def change_red_to_white(image_path):
    img = cv2.imread(image_path)

    lower_red = np.array([0,0,100])
    upper_red = np.array([50,50,255])

    mask = cv2.inRange(img, lower_red, upper_red)
    img[mask > 0] = (255, 255, 255)

    cv2.imwrite(image_path, img)